package com.example.consumer.controller;

import com.example.consumer.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author whn
 */
@RestController
@RequestMapping("/test")
@CrossOrigin
public class ProductConsumerController {
    @Resource
    private TestService testService;
    /**
     * 查询
     *
     * @param
     * @return
     */
    @GetMapping("/get")
    public Map<String, String> get() {
        return testService.get();
    }

    @GetMapping("/set")
    public void set(@RequestParam("name") String name) {
        testService.set(name);
    }

    @GetMapping("/getRoleList")
    public Map<String, Object> getRoleList(@RequestParam("remark") String name) {
        return testService.getRoleList(name);
    }
}
